package com.interagriculture.controller;

import com.interagriculture.annotation.AdminVerify;
import com.interagriculture.common.Result;
import com.interagriculture.entity.StudioInfo;
import com.interagriculture.service.StudioInfoService;
import com.interagriculture.service.UserInfoService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author 11 2024/11/12
 */
@RestController
@RequestMapping("/adminStudio")
public class AdminStudioInfoController {


    @Resource
    private StudioInfoService studioInfoService;

    @PostMapping("/saveOrUpdate")
    @AdminVerify
    public Result saveOrUpdate(@RequestBody StudioInfo studioInfo){
        studioInfoService.saveOrUpdateInfo(studioInfo);
        return Result.ok();
    }

    @DeleteMapping("/delete/{id}")
    @AdminVerify
    public Result deleteById(@PathVariable Integer id){
        studioInfoService.deleteById(id);
        return Result.ok();
    }
}
